package com.lagou.serializer;

/**
 * @program: stage_3_module_1
 * @description:
 * @author: zhangxiaoyang
 * @date: 2020-08-18 05:35
 **/

import com.alibaba.fastjson.JSON;


public class JSONSerializer implements Serializer {


    @Override
    public byte[] serialize(Object object) {
        return JSON.toJSONBytes(object);

    }


    @Override
    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return JSON.parseObject(bytes, clazz);

    }

}
